package DecoratorPattern.example;

public class Fan extends Decorator {
    private final String name;

    public Fan(Component p, String name) {
        super(p);
        this.name = name;
    }

    @Override
    public void work() {
        this.rotate();
        this.component.work();
    }

    public void rotate() {
        System.out.println("CPU Fan " + name + " is working!");
    }
}
